<?php
class Zend_View_Helper_picSrc extends Zend_View_Helper_Abstract
{
    public $view;

    public function picSrc($id,$opt)
    {
        $cl = Zend_Registry::get('emmsClient'); 
        $db = Zend_Registry::get('emmsDb');
        $path = sprintf('db/%s/%s/img/%s/%s.jpg',$cl,$db,$opt,$id);
        if (is_file($path)) return '/'.$path;
        return sprintf('/db/%s/%s/img/0.jpg',$cl,$db);
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}